home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-03 | 3.8 KB | 131 lines | [TEXT/MPS ] |
- //----------------------------------------------------------------------------------------
- // UContainerApplication.cp
- // Copyright © 1996 by Apple Computer, Inc. All rights reserved.
- //----------------------------------------------------------------------------------------
-
-
- #ifndef __UContainerApplication__
- #include "UContainerApplication.h"
- #endif
-
- #ifndef __UContainerDocument__
- #include "UContainerDocument.h"
- #endif
-
- #ifndef __UCONTAINER__
- #include "UContainer.h"
- #endif
-
-
- #ifndef __UMENUMGR__
- #include "UMenuMgr.h"
- #endif
-
- #define kStandardMenuBar 128
- #define kODMenuBar 129
-
- //----------------------------------------------------------------------------------------
- // Constants:
-
-
- const OSType kSignature = 'SS07'; // Application signature
-
- const CommandNumber cCommandHandledByApplication = 400;
-
- //========================================================================================
- // CLASS TContainerApplication
- //========================================================================================
- #undef Inherited
- #define Inherited TApplication
-
- #pragma segment AInit
- MA_DEFINE_CLASS_M1(TContainerApplication, Inherited);
-
- //----------------------------------------------------------------------------------------
- // TContainerApplication constructor
- //----------------------------------------------------------------------------------------
- #pragma segment AOpen
-
- TContainerApplication::TContainerApplication()
- {
-
- #if qOpenDoc
- if (gContainerLib)
- {
- fDisplayedMenus = kODMenuBar;
- }
- else
- #endif
- {
- fDisplayedMenus = kStandardMenuBar;
- }
- }
-
- //----------------------------------------------------------------------------------------
- // TContainerApplication destructor
- //----------------------------------------------------------------------------------------
- #pragma segment MADestructorRes
-
- TContainerApplication::~TContainerApplication()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // TContainerApplication::IContainerApplication:
- //----------------------------------------------------------------------------------------
- #pragma segment AInit
-
- void TContainerApplication::IContainerApplication()
- {
- this->IApplication(kFileType,kSignature);
- } // TContainerApplication::IContainerApplication
-
- //----------------------------------------------------------------------------------------
- // TContainerApplication::DoMakeDocument:
- //----------------------------------------------------------------------------------------
- #pragma segment AOpen
-
- TDocument* TContainerApplication::DoMakeDocument(CommandNumber /* itsCommandNumber */,
- TFile* itsFile)
- {
- TContainerDocument* aDocument = new TContainerDocument;
-
- aDocument->IContainerDocument(itsFile,kSignature);
- return aDocument;
- } // TContainerApplication::DoMakeDocument
-
- //----------------------------------------------------------------------------------------
- // TContainerApplication::DoMenuCommand:
- //----------------------------------------------------------------------------------------
- #pragma segment ASelCommand
-
- void TContainerApplication::DoMenuCommand(CommandNumber aCommandNumber)
- {
- switch (aCommandNumber)
- {
- case cCommandHandledByApplication :
- SysBeep(2);
- break;
- default:
- Inherited::DoMenuCommand(aCommandNumber);
- break;
- }
- } // TContainerApplication::DoMenuCommand
-
- //----------------------------------------------------------------------------------------
- // TContainerApplication::DoSetupMenus:
- //----------------------------------------------------------------------------------------
- #pragma segment ARes
-
- void TContainerApplication::DoSetupMenus()
- {
- Inherited::DoSetupMenus();
-
- Enable(cCommandHandledByApplication,TRUE);
- } // TContainerApplication::DoSetupMenus
-
- //----------------------------------------------------------------------------------------
- // End of UContainerApplication.cp
-
- #pragma segment Inline
-